home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PROGEDIT / 3458A.ZIP / AMAC44A.ZIP / BOOK25.QM < prev    next >
Text File  |  1992-06-22  |  15KB  |  335 lines

  1. *                               BOOK25.QM
  2. *                      Macros To Jump To BookMarks and
  3. *                         Load Macros Across Files
  4. *                        Written by Tom Hogshead
  5. *                                 6/22/92
  6. *  Key    Subfile              Description
  7. * =====  ============  ==================================================
  8. *  @4     <BEST>       - Jump from Index Line to First Word ( )
  9. *                        Enclosed with ( ) in the File Below,
  10. *                       (Quicker Version of @1 That Positions
  11. *                        Cursor on First Index Selection Line)
  12. *  @1                  - Jump from Index Line to First Word Enclosed
  13. *                        with ( ) in the File Below
  14. *  @2                  - Finds First Word on Cursor Line in File Below,
  15. *                       "Marked" or "Unmarked", and Encloses Selected
  16. *                        Found Word in File with ( )
  17. *  @3                  - Copies Word at Cursor in File to Index Enclosing
  18. *                        Word at Cursor and Word in Index with ( )
  19. *  f4                  - Continues Searching Until the Desired Word
  20. *                        is Found in File Below Using @2
  21. *--
  22. *  @f   {e:\up\bok001} - Jump from Index Line to Macro                    |chg
  23. *  @6   {e:\up\bok001} - Read/Load Txtfile Macros from Index              |chg
  24. *  @7   {e:\up\bok001} - Read Macros from Index, Txtfile Not Loaded       |chg
  25. *  @8   {e:\up\bok001} - Read/Load Macros at Cursor Line                  |chg
  26. *  @9   {e:\up\bok001} - Read Macros at Cursor Line, Txtfile Not Loaded   |chg
  27. *  @eq  {e:\up\bok001} - Read Current Txtfile's Macros  (@=)
  28. *  @p   {e:\up\bok001} - Decrypt Macro @f
  29. *  f4   {e:\up\bok001} - Jump to Another Occurence of Index Selection
  30. *--
  31. *  @h                  - Jump To Index Item In Current File
  32. *
  33. *       {e:\up\INDX*}  - Index of Macros In AMACxx.ZIP
  34. *
  35. *       Description
  36. *       Configuration, MUST Do
  37. *       Using Macros,  Startup and Macro Execution
  38. *       Macros
  39. *       Other Macros not Included
  40. *       Version History
  41. *
  42. *-- eoi
  43.  
  44.  
  45. * (Description)
  46. * --------------
  47.  
  48. *       BOOK25.QM are a series of macros enabling the user to load,
  49. *       read, and/or invoke macros located in any file.  Files, items
  50. *       or macros may be quickly located in any file by enclosing a key
  51. *       identification word in parentheses and placing the bookmarked
  52. *       word as the first word in an Index line.  This version includes
  53. *       macros using the new and *not recommended* technique of a
  54. *       "macro reading a macro".
  55.  
  56. *       A theoretically unlimited number of macros (in excess of the
  57. *       limited 0.5k QConfig.dat buffer) located in files other than
  58. *       the current file can be quickly located and easily executed at
  59. *       any time using either @f, @6, @7 or @8 while editing any file.
  60. *       (See bok001.qm for additional discussion).
  61.  
  62. *       For anyone using more than a few macros and who might be tight
  63. *       on QConfig macro buffer space, the macros in bok001.qm may be
  64. *       of interest; they enable me to have immediate access while
  65. *       editing any file, to quickly load and run over 500 macros in
  66. *       about 100 files compiled to more than 20,000 macro bytes -- and
  67. *       with 50 bytes QConfig macro buffer space to spare.
  68.  
  69. *       The techniques, necessary configuring, and use of these
  70. *       bookmark macros require a considerable knowlege of QMAC and
  71. *       QEdit macro language.  The new techniques they involve have not
  72. *       been fully tested.  These are my first real effort to have a
  73. *       macro read a macro, a heretofore (and still) not recommended
  74. *       procedure.  Until this "macro reading a macro" technique can be
  75. *       fully tested and proven to be viable, I do *not* advise the
  76. *       user use this technique in other macros without full knowledge
  77. *       of it's pitfalls and limitations.
  78.  
  79. * (Configuration), MUST Do
  80. * ---------------------------
  81. *   In order to access files and/or invoke macros in different
  82. *   directories, all files listed in 'e-up.lst' MUST be configured
  83. *   for the user directory containing AMAC files.  My directory,
  84. *   e:\up, occurs over 100 times and must be changed using the
  85. *   following configuration procedure which takes a few minutes
  86. *   to do the search/replace and compile using QMAC:
  87.  
  88. *     1)   Make a two letter directory on your hard drive named \UP.
  89. *          If this conflicts, then any two letter directory will
  90. *          suffice.
  91.  
  92. *     2)   First expand all files in AMACxx.ZIP to \UP directory.
  93.  
  94. *     3)   Change to \UP directory.
  95.  
  96. *     4)   Replace 'e:\up\' with  [d:\path] in all files in the file
  97. *          list 'e-up.lst' using SRQ.BAT search/replace batch file from
  98. *          SRCHxx.QM:
  99. *                   SRQ.BAT  e:\up  [d:\path]  @e-up.lst  <enter>
  100. *          e.g., if c:\amac is your directory containing AMAC files:
  101.  
  102. *                   SRQ.BAT  e:\up   c:\amac   @e-up.lst  <enter>
  103. *                                    ^^^^^^^
  104. *          The total size of files in e-up.lst is greater than 400k
  105. *          which is larger than the QEdit can handle, so we must either
  106. *          use SRQ.BAT as shown here, or repeat the search/replace
  107. *          using SR.BAT until all replacements have been made.
  108.  
  109. *     5)   After the search/replace is complete, exit QEdit and convert
  110. *          changed txtfiles to macfiles using QMAC with the following:
  111. *                   E-UP.BAT
  112.  
  113. *     6)   Put the following bok001.qm macro in QCONFIG.DAT, changing
  114. *          dir:\ to your directory containing AMAC files:
  115. *               @f macro_begin macroread "[d:\path\]bok001.mac" return
  116. *            e.g.,
  117. *               @f macro_begin macroread "c:\amac\bok001.mac"   return
  118. *                                         ^^^^^^^
  119.  
  120. *     7)   The following macros in bok001.qm should also be installed
  121. *          in QConfig.dat and then commented out of bok001.qm after
  122. *          installation.  They will then be available in any editing
  123. *          session as long as no subsequently installed macros have the
  124. *          same keys:
  125. *           ^f1  Cycle Between Starting and Selected Files After Invoking @6
  126. *           @0   Save Current Macro Buffer, Read Previously Saved Macro Buffer
  127. *           @=   Read Current Txtfile Macros
  128. *           @-   Read Previously Saved Macro Buffer
  129.  
  130. *     8)   After completion of steps 4 and 5 above, changing c:\ to a
  131. *          ram drive in all macros in bok001.qm will increase macro
  132. *          execution speed, although this in not necessary.
  133.  
  134. * (Using) Macros
  135. * ---------------
  136. *   The following examples demonstrate the use of macros in
  137. *   bok001.qm using @6 and @f.  To execute bok001.qm macros, be
  138. *   sure Insert is ON and then:
  139. *       1) Load BOOK25.QM into a QEdit window.
  140. *       2) Read the macfile bok001.mac as follows:
  141. *             @f  <enter>
  142. *          Macros @f and all other macros in bok001.qm are now loaded.
  143. *       3) Run @6.  Cursor down to desired txtfile in INDXxx.QM to load
  144. *          the selected txtfile, and press <enter>.  At the next pause,
  145. *          cursor down to desired macro to load it's txtfile and read
  146. *          it's macros. Selecting @f will load subfile bok001.qm  and
  147. *          read it's macros, with the cursor positioned on a
  148. *          description of @f.
  149. *       4) Press ^f1 to cycle between BOOK25.QM and bok001.qm
  150. *       5) Press @6 again to select, load and read another set of
  151. *          macros.
  152.  
  153. * These macros require "QEdit and QMAC v2.1, February, 1990" or later.
  154.  
  155. * (Other) Macros: See ALLMACRO.INF for other macros.  See also
  156. *                 JMPPOSxx.QM for macros to jump to positions within
  157. *                 and across files using position markers.
  158.  
  159. * Use of @(h)
  160. * ------------
  161. * @h is key used for @1 or @4 in many other macro files.  For use of @h
  162. * see instructions in @1 below.
  163.  
  164. * (Macros)
  165. *                            M A C R O S
  166. * -------------------------------------------------------------------------
  167. * @(1) Jump To First Word On Cursor Line "Marked" In The File Below
  168. * -------------------------------------------------------------------------
  169. * @1 macro has 2 steps:
  170. *     1. Press @1.  Line 1 is marked to highlight.  Cursor down to
  171. *        desired line in Index.
  172. *     2. Press <enter>.  The macro then jumps to the first word
  173. *        cursor line in the File below.
  174. * @1 differs from @f in that @1 will only jump to an Index item in the
  175. * current file.  @f will find them in an unlimited number of files.
  176.  
  177. @1 macrobegin
  178.         unmarkblock defaultwordset
  179.         begfile markline markline
  180.         pause
  181.         wordright markword copy endpara
  182.         find "(" paste ")" return "I" return
  183.         jfalse NOMARK
  184.         begline maketopofscreen scrollup
  185.         jump END
  186.     NOMARK:
  187.         begfile
  188.     END:
  189. *
  190. * 32 bytes Tue  09-11-1990  11:19:51
  191. * 33 bytes Wed  06-26-1991  11:23:27 (TH @1, added defaultwordset)
  192. * 33 bytes Fri  07-05-1991  10:31:13 (TH @1, moved makectrofscreen down)
  193. * 33 bytes Wed  07-10-1991  10:11:24 (TH @1, moved makectrofscreen back up)
  194. * 34 bytes Sun  07-28-1991  15:48:33 (TH @1, changed found cursor pos |a)
  195.  
  196. * This above version of @1 is 34 bytes.  You may want to use the
  197. * following shorter version (22 bytes) where searching starts from
  198. * cursor line, not at the end of the first paragraph of the (Index), as
  199. * above:
  200.  
  201. * @1 macrobegin
  202. *        defaultwordset begfile
  203. *        pause wordright markword copy
  204. *        find "(" paste ")" return delline return
  205. *        begline
  206. *
  207. * 21 bytes Tue  09-11-1990  11:22:45 added markline
  208. * 22 bytes Wed  06-26-1991  11:23:27 (TH @1, added defaultwordset)
  209. * 20 bytes Tue  05-26-1992  11:34:59 (TH @1, shortest possible)
  210.  
  211. * 
  212. * ----------------------------------------------------------------------
  213. * @(2) Finds Word In File, Adds () To Found Word And Returns To Index
  214. * ----------------------------------------------------------------------
  215. *      @2 macro has 3 steps:
  216. *
  217. *       1. Press Alt and 2 at the same time. The macro finds first word
  218. *       on the cursor line in the File below. If first found word
  219. *       is not the desired occurrence, press F4 for next word or until
  220. *       the desired occurrence is found.
  221. *
  222. *       2. When the desired word and location are found, press Enter.
  223. *       The macro places () around desired found word and then return
  224. *       to the original word in the Index.
  225. *
  226. *       3. Press Enter again and the macro places () around the original
  227. *       word in the Index. The cursor ends at end of the marked word in
  228. *       the Index so comments may be added. Be careful not to mark the
  229. *       same word more than once or only the first occurrence of the word
  230. *       in the File will be found with @1 and @f.
  231. *
  232. @2      macrobegin
  233.         defaultwordset wordright markword copy
  234.         find paste return "I" return
  235.         pause "(" markword gotoblockend ")"
  236.         pause begfile find return delline return
  237.         pause
  238.         markword gotoblockbeg "(" gotoblockend ") " unmarkblock
  239. *
  240. * 35 bytes Sat  07-28-1990  15:17:55
  241. * 36 bytes Wed  06-26-1991  12:13:45 (TH @2, added defaultwordset)
  242. * 38 bytes Sun  07-28-1991  16:24:04 (TH @2, changed Find's)
  243.  
  244. * 
  245. * ----------------------------------------------------------------------
  246. * @(3)  Puts Word @ Cursor In Index With () Around Marked Word And In Index
  247. * ----------------------------------------------------------------------
  248. *        @3 macro has 2 steps:
  249. *
  250. *        1. Press Alt and 3 at the same time. Macro marks the word at the
  251. *        cursor in the File, then returns to the the end of the Index.
  252. *        The marked word in the File is then copied at the end of the
  253. *        Index with () around it. The cursor is at end of word so
  254. *        comments may be added in the Index.
  255. *
  256. *        2. Press Enter and the cursor returns to the beginning of
  257. *        the line of the marked word in the File.
  258. *
  259. @3      macrobegin
  260.         defaultwordset markword gotoblockbeg "(" gotoblockend ")"
  261.         copy begfile endpara addline begline "*" cursorright "("
  262.         paste endline cursorright unmarkblock makectrofscreen
  263.         pause
  264.         begline wordright markword copy find "(" paste ")" return return
  265.         begline
  266. *
  267. * 42 bytes Sat  07-28-1990  15:18:04
  268. * 43 bytes Wed  06-26-1991  12:13:32 (TH @3, added defaultwordset)
  269. * 41 bytes Sun  07-28-1991  16:16:19 (TH @3, shortened |a)
  270.  
  271. * 
  272. * -------------------------------------------------------------------------
  273. * @(4) Jump To First Word On Cursor Line "Marked" In The File Below
  274. *      Positions Cursor On First Index Selection Line For Quicker Selection
  275. * -------------------------------------------------------------------------
  276. * This macro is an alternate version of @1 that positions the cursor on
  277. * the first Index item line instead of the top line as @1 does.  If the
  278. * first Index item line does not have the first word enclosed in ( ),
  279. * the cursor is positioned on the line containing a '('.  This enables
  280. * the user to quickly make a selection to jump to.  See @1 for
  281. * instructions.  Remove setscreenOFF|ON if you are not using QEdit
  282. * v2.15.
  283.  
  284. @4 macrobegin
  285.         setscreenoff
  286.         defaultwordset begfile endpara
  287.         unmarkblock markline begfile
  288.         find "(" return "L" return
  289.         jfalse NOMARK
  290.         makectrofscreen begfile
  291.         unmarkblock markline markline
  292.         prevposition begline
  293.         setscreenon pause setscreenoff
  294.         wordright markword copy endpara
  295.         find "(" paste ")" return "I" return
  296.         jfalse NOMARK
  297.         begline maketopofscreen scrollup jump END
  298.     NOMARK:
  299.         begfile
  300.     END:
  301. *
  302. * 34 bytes Sun  07-28-1991  15:48:33 (TH @1)
  303. * 52 bytes Wed  07-31-1991  14:43:31 (TH @4 in BOOKxx.QM)
  304. * 55 bytes Fri  11-08-1991  13:52:55 (TH @4, requires QEdit v2.15)
  305.  
  306. * 
  307. * ----------------------------------------------------------------------
  308. * (f4) Continues Until Desired Word Is Found Using @2
  309. * ----------------------------------------------------------------------
  310. *       (see @2 for use)
  311.  
  312. f4      repeatfind                      * Repeat find until desired word
  313.                                         * and location are found
  314. * 5 bytes Sat  07-28-1990  15:18:17 (TH f4)
  315.  
  316. * (Version) History
  317. * -------------------
  318. *   2.3 - Modified @f for QEdit v2.15.                                 2/17/92
  319. *                   (In Amac42.zip)
  320. *   2.4 - Added setscreenOFF|ON to @6/7/8/9 in bok001.qm.               5/4/92
  321. *       - Modified @f in bok001.qm for macros in subfiles.              5/4/92
  322. *                   (In Amac43.zip)
  323. *   2.5 - Removed @0, @- and ^f1.                                      5/31/92
  324. *         Modified @6/7/8/9 in bok001.qm.                              5/31/92
  325. *       - Switched @8/9 keys bok001.qm.                                 6/1/92
  326. *       - Modified @5/6 key find routine in subfiles.                   6/3/92
  327. *       - Updated BOOK*.QM.                                            6/22/92
  328. *
  329. *
  330. *
  331. *
  332. *
  333. *
  334. *--eof
  335.